<script>
  // a class representing a dependency
  // exposing it on window is necessary for testing
  window.Dep = class Dep {
    constructor() {

    }
    depend() {

    }
    notify() {
      if (up) {
        autorun(up)
      }
    }
  }

  function autorun(update) {
    up = update
    up()
  }
</script>